package com.choosefine.base.shixiaobao.common.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class Swagger2 {

    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.choosefine.base.shixiaobao"))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
//    	 ApiInfo apiInfo = new ApiInfo("趋恒服务端APIs",//大标题
//                 "劳务相关接口，获取个数，获取列表，注意：",//小标题
//                 "1.0",//版本
//                 "",
//                 "charry wei",//作者
//                 "趋恒网络科技有限公司",//链接显示文字
//                 ""//网站链接
//         );
    	
        return  new ApiInfoBuilder()
        .title("趋恒服务端APIs")
        .description("API文档")
        .contact("summer_last")
        .version("1.0")
        .build();
    }

}
